package main

import (
	"fmt"
	"github.com/henrylee2cn/goutil"
	"io/ioutil"
	"path/filepath"
	"studygo/other/picutils"
)

func main() {
	test("curl", "--referer", "https://img.onvshen.com:85/gallery/24633/33345/s/0.jpg", "-o",
		"d:/tmp/psnv/33345_41/000.jpg")

	var picSavePath = "d:/tmp/psnv/gallery/"
	println(picSavePath)
	//os.Stat(picSavePath)
	//all := strings.ReplaceAll(picSavePath, "/", "\\")

	println(picSavePath)
	picutils.ExecuteCmdOnly("explorer", picSavePath)
	println()
	slash := filepath.FromSlash(picSavePath)
	println(slash)
	println()

}

func test(name string, arg ...string) {
	fmt.Println(arg)
	fmt.Println(len(arg))
	fmt.Println(arg[len(arg)-1])
	if !goutil.FileExists("filepath") {

	}
	dirIsEmpty("D:\\soft\\GOPATH\\src\\studygo\\other\\downnv2\\heisi\\31810_69")
}
func dirIsEmpty(dirName string) bool {
	dir, _ := ioutil.ReadDir(dirName)
	if len(dir) == 0 {
		return true
	}
	return false
}
